



import pandas as pd


def add_content():
    xlsx_path = '/Users/feidao/Documents/me/note/development/vue/vue-learning/yixin-backend/database/basic.xlsx'
    df1 = pd.read_excel(xlsx_path, sheet_name="zhongyao")
    df2 = pd.read_excel(xlsx_path, sheet_name="fangji")
    
    # 增加一列content用来记录所有的数据
    df1["content"] = df1["name"].str.cat([df1["desc"],df1["function"],df1["source"]],sep="|")
    # print(df1)
    
    df2['content'] = df2['name'].str.cat([df2["source"],df2["detail"],df2["use"],df2["function"],df2["fix"]], sep="|")
    print(df2)
    # 追加需要用 mode = a
    with pd.ExcelWriter(xlsx_path, mode="a", if_sheet_exists="replace") as writer:
        # with pd.ExcelWriter('basic.xlsx') as writer:
        df1.to_excel(writer, sheet_name='zhongyao2', index=False)
        df2.to_excel(writer, sheet_name='fangji2', index=False)
    return 


def add_tag():
    return 


def add_index():
    return 


if __name__ == '__main__':
    add_content()
